USE [RD_COMMON]
GO

/****** Object:  Index [PK_Star_BusinessUnit]    Script Date: 08/20/2010 15:24:43 ******/
ALTER TABLE [dbo].[Star_BusinessUnit] ADD  CONSTRAINT [PK_Star_BusinessUnit] PRIMARY KEY CLUSTERED 
(
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO


USE [RD_COMMON]
GO

/****** Object:  Index [IX_BusinessUnit_BusinessUnitID]    Script Date: 08/20/2010 15:24:38 ******/
CREATE NONCLUSTERED INDEX [IX_BusinessUnit_BusinessUnitID] ON [dbo].[Star_BusinessUnit] 
(
	[BusinessUnitID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_196]    Script Date: 08/20/2010 15:24:38 ******/
CREATE NONCLUSTERED INDEX [missing_index_196] ON [dbo].[Star_BusinessUnit] 
(
	[BusinessUnitID] ASC
)
INCLUDE ( [BusinessUnitCode],
[BusinessUnit],
[AddressNumber]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_386]    Script Date: 08/20/2010 15:24:38 ******/
CREATE NONCLUSTERED INDEX [missing_index_386] ON [dbo].[Star_BusinessUnit] 
(
	[Category01Code] ASC
)
INCLUDE ( [BusinessUnitID]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_463]    Script Date: 08/20/2010 15:24:38 ******/
CREATE NONCLUSTERED INDEX [missing_index_463] ON [dbo].[Star_BusinessUnit] 
(
	[Type] ASC
)
INCLUDE ( [BusinessUnitID]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO


USE [RD_COMMON]
GO

/****** Object:  Index [PK_Star_Cost]    Script Date: 08/20/2010 15:25:53 ******/
ALTER TABLE [dbo].[Star_Cost] ADD  CONSTRAINT [PK_Star_Cost] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[Location] ASC,
	[LotNumber] ASC,
	[CostMethodCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO



USE [RD_COMMON]
GO

/****** Object:  Index [IX_Cost_CostID]    Script Date: 08/20/2010 15:25:34 ******/
CREATE NONCLUSTERED INDEX [IX_Cost_CostID] ON [dbo].[Star_Cost] 
(
	[CostID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_269]    Script Date: 08/20/2010 15:25:34 ******/
CREATE NONCLUSTERED INDEX [missing_index_269] ON [dbo].[Star_Cost] 
(
	[ItemNumber02] ASC,
	[CostMethodCode] ASC
)
INCLUDE ( [BusinessUnitCode],
[UnitCost],
[DateUpdated]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [PK_DATESPattern]    Script Date: 08/20/2010 15:26:12 ******/
ALTER TABLE [dbo].[Star_Dates] ADD  CONSTRAINT [PK_DATESPattern] PRIMARY KEY CLUSTERED 
(
	[CompanyDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_Dates]    Script Date: 08/20/2010 15:26:23 ******/
CREATE NONCLUSTERED INDEX [IX_Dates] ON [dbo].[Star_Dates] 
(
	[Dates] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_778]    Script Date: 08/20/2010 15:26:23 ******/
CREATE NONCLUSTERED INDEX [missing_index_778] ON [dbo].[Star_Dates] 
(
	[FiscalMonth] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [PK_Star_Item]    Script Date: 08/20/2010 15:26:49 ******/
ALTER TABLE [dbo].[Star_Item] ADD  CONSTRAINT [PK_Star_Item] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_Item_ItemNumberID]    Script Date: 08/20/2010 15:26:57 ******/
CREATE NONCLUSTERED INDEX [IX_Item_ItemNumberID] ON [dbo].[Star_Item] 
(
	[ItemNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_119]    Script Date: 08/20/2010 15:26:57 ******/
CREATE NONCLUSTERED INDEX [missing_index_119] ON [dbo].[Star_Item] 
(
	[SalesCategory01Code] ASC
)
INCLUDE ( [ItemNumberID],
[SourceID],
[Source],
[ItemNumber],
[ItemNumber02],
[ItemNumber03],
[Description01],
[Description02],
[SalesCategory01],
[SalesCategory02Code],
[SalesCategory02],
[SalesCategory03Code],
[SalesCategory03],
[SalesCategory04Code],
[SalesCategory04],
[SalesCategory05Code],
[SalesCategory05],
[SalesCategory06Code],
[SalesCategory06],
[SalesCategory07Code],
[SalesCategory07],
[SalesCategory08Code],
[SalesCategory08],
[SalesCategory09Code],
[SalesCategory09],
[SalesCategory10Code],
[SalesCategory10],
[PurchasingCategory01Code],
[PurchasingCategory01],
[PurchasingCategory02Code],
[PurchasingCategory02],
[PurchasingCategory03Code],
[PurchasingCategory03],
[PurchasingCategory04Code],
[PurchasingCategory04],
[PurchasingCategory05Code],
[PurchasingCategory05],
[PurchasingCategory06Code],
[PurchasingCategory06],
[PurchasingCategory07Code],
[PurchasingCategory07],
[PurchasingCategory08Code],
[PurchasingCategory08],
[PurchasingCategory09Code],
[PurchasingCategory09],
[PurchasingCategory10Code],
[PurchasingCategory10],
[ProductGroupCode],
[ProductGroup],
[ItemPriceGroupCode],
[ItemPriceGroup],
[StockingTypeCode],
[StockingType],
[InsertIndicator],
[InsertDate],
[ChangeIndicator],
[ChangeDate],
[DeleteIndicator],
[DeleteDate],
[PurgeDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_172]    Script Date: 08/20/2010 15:26:57 ******/
CREATE NONCLUSTERED INDEX [missing_index_172] ON [dbo].[Star_Item] 
(
	[SalesCategory03Code] ASC
)
INCLUDE ( [ItemNumberID],
[SourceID],
[ItemNumber],
[ItemNumber02]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_433]    Script Date: 08/20/2010 15:26:57 ******/
CREATE NONCLUSTERED INDEX [missing_index_433] ON [dbo].[Star_Item] 
(
	[Description01] ASC
)
INCLUDE ( [ItemNumberID],
[SourceID],
[ItemNumber02]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [PK_Star_ItemBranch]    Script Date: 08/20/2010 15:27:10 ******/
ALTER TABLE [dbo].[Star_ItemBranch] ADD  CONSTRAINT [PK_Star_ItemBranch] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_IB_Addressnumber]    Script Date: 08/20/2010 15:27:18 ******/
CREATE NONCLUSTERED INDEX [IX_IB_Addressnumber] ON [dbo].[Star_ItemBranch] 
(
	[AddressNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_ItemBranch_ItemBranchID]    Script Date: 08/20/2010 15:27:18 ******/
CREATE NONCLUSTERED INDEX [IX_ItemBranch_ItemBranchID] ON [dbo].[Star_ItemBranch] 
(
	[ItemBranchID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_257]    Script Date: 08/20/2010 15:27:18 ******/
CREATE NONCLUSTERED INDEX [missing_index_257] ON [dbo].[Star_ItemBranch] 
(
	[SalesCategory01Code] ASC
)
INCLUDE ( [ItemNumber],
[BusinessUnitCode],
[SafetyStock]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_660]    Script Date: 08/20/2010 15:27:18 ******/
CREATE NONCLUSTERED INDEX [missing_index_660] ON [dbo].[Star_ItemBranch] 
(
	[SourceID] ASC,
	[BusinessUnitCode] ASC
)
INCLUDE ( [ItemNumber],
[AddressNumber]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [PK_Star_Supplier]    Script Date: 08/20/2010 15:27:37 ******/
ALTER TABLE [dbo].[Star_Supplier] ADD  CONSTRAINT [PK_Star_Supplier] PRIMARY KEY CLUSTERED 
(
	[SupplierNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [IX_SourceID_ParentNum]    Script Date: 08/20/2010 15:27:47 ******/
CREATE NONCLUSTERED INDEX [IX_SourceID_ParentNum] ON [dbo].[Star_Supplier] 
(
	[SourceID] ASC,
	[ParentNumber] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Supplier_SupplierNumberID]    Script Date: 08/20/2010 15:27:47 ******/
CREATE NONCLUSTERED INDEX [IX_Supplier_SupplierNumberID] ON [dbo].[Star_Supplier] 
(
	[SupplierNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_422]    Script Date: 08/20/2010 15:27:47 ******/
CREATE NONCLUSTERED INDEX [missing_index_422] ON [dbo].[Star_Supplier] 
(
	[SearchTypeCode] ASC
)
INCLUDE ( [SupplierNumberID],
[SupplierNumber],
[SupplierName],
[PaymentTermsAP],
[PaymentTerms],
[SearchType]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

USE [RD_COMMON]
GO

/****** Object:  Index [PK_Star_UOMConversionFactors]    Script Date: 08/20/2010 15:27:57 ******/
ALTER TABLE [dbo].[Star_UOMConversionFactors] ADD  CONSTRAINT [PK_Star_UOMConversionFactors] PRIMARY KEY CLUSTERED 
(
	[BusinessUnitCode] ASC,
	[ItemNumber] ASC,
	[UnitOfMeasure] ASC,
	[RelatedUnitOfMeasure] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO
USE [RD_COMMON]
GO

/****** Object:  Index [missing_index_303]    Script Date: 08/20/2010 15:28:09 ******/
CREATE NONCLUSTERED INDEX [missing_index_303] ON [dbo].[Star_UOMConversionFactors] 
(
	[RelatedUnitOfMeasure] ASC
)
INCLUDE ( [ItemNumber],
[UnitOfMeasure],
[ConversionFactor]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_6]    Script Date: 08/20/2010 15:28:09 ******/
CREATE NONCLUSTERED INDEX [missing_index_6] ON [dbo].[Star_UOMConversionFactors] 
(
	[ItemNumber] ASC,
	[UnitOfMeasure] ASC,
	[RelatedUnitOfMeasure] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO


